home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / Jooky / startplayer.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-01  |  644 b   |  31 lines

  1. #include "defines.h"
  2. #include "includes.h"
  3.  
  4. void startplayer(char *dir, char *file)
  5. {
  6.     int x;
  7.     char *params[20];
  8.  
  9.     for (x=0;x<20;++x) params[x]=calloc(1,256);
  10.     
  11.     strcat(params[0],playerdir);
  12.     strcat(params[0],"/");
  13.     strcat(params[0],player);
  14.  
  15.     strcat(params[1],player);
  16.  
  17.     for (x=0;playerflags[x]!=(char *)NULL;++x) strcpy(params[x+2],playerflags[x]);
  18.  
  19.     strcpy(params[x+2],dir);
  20.     strcat(params[x+2],"/");
  21.     strcat(params[x+2],file);
  22.  
  23.     params[x+3]=0;
  24.  
  25.     freopen(playeroutput,"a+",stdin);
  26.     freopen(playeroutput,"a+",stdout);
  27.     freopen(playeroutput,"a+",stderr);
  28.  
  29.     if (execv(params[0],¶ms[1])==-1) perror("execv");
  30. }
  31.